package com.md.api.entity;

import org.springframework.core.io.InputStreamSource;

import java.util.ArrayList;
import java.util.List;

public class SendMail {

	private String email;
	
	private String subject;
	
	private String content;
	
	private List<Attachment> attachmentList = new ArrayList<Attachment>();
	
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public List<Attachment> getAttachmentList() {
		return attachmentList;
	}

	public class Attachment{
		public Attachment(InputStreamSource inputStream, String fileName, String contentType){
			this.inputStream = inputStream;
			this.fileName = fileName;
			this.contentType = contentType;
		}
		
		private InputStreamSource inputStream;
		
		private String fileName;
		
		private String contentType;

		public InputStreamSource getInputStream() {
			return inputStream;
		}

		public void setInputStream(InputStreamSource inputStream) {
			this.inputStream = inputStream;
		}

		public String getFileName() {
			return fileName;
		}

		public void setFileName(String fileName) {
			this.fileName = fileName;
		}

		public String getContentType() {
			return contentType;
		}

		public void setContentType(String contentType) {
			this.contentType = contentType;
		}
	}
	
	public Attachment instanceAttachment(InputStreamSource inputStream, String fileName, String contentType ) {
		return new Attachment(inputStream, fileName, contentType);
	}
}
